<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // Vue.directive('名字',{

    // })
    var obj = {
      focus:{
        inserted(dom,option){}
      },
      color:{
        inserted(dom,option){}
      },
      名字:{

      }
    }
    // Object.keys可以得到任意对象所有的属性名，组成一个数组
    // console.log(Object.keys(obj))
    Object.keys(obj).forEach(item=>{
      // console.log(obj[item])
      Vue.directive(item,obj[item])
    })
  </script>
</body>
</html>
